package hn.sigit.model.ladm.special;

import hn.sigit.model.commons.IExtArchive;
import hn.sigit.model.commons.ISource;
import hn.sigit.model.ladm.external.ExtArchive;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="LA_Source", schema="ladm_special")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorValue("LA_Source")
public abstract class LA_Source extends VersionedObject implements ISource, Serializable {
	private static final long serialVersionUID = 1L;
	
	private long sID;
	private hn.sigit.model.ladm.party.LA_Party party;
	private java.util.Date lifeSpanStamp;
	private byte mainType;
	private java.util.Date acceptance;
	private java.util.Date recordation;
	private java.util.Date submission;
	private IExtArchive archive;


	public LA_Source() {
	}

	
	@Id
	@Column(name="ID", nullable=false)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="la_source_id_gen")
	@SequenceGenerator(name="la_source_id_gen", sequenceName="la_source_id_seq", allocationSize=1)
	public long getsID() {
		return sID;
	}
	protected void setsID(long value) {
		this.sID = value;
	}
	@Transient
	public long getORMID() {
		return getsID();
	}
	
	@Column(name="Acceptance", nullable=true)
	public java.util.Date getAcceptance() {
		return acceptance;
	}
	public void setAcceptance(java.util.Date value) {
		this.acceptance = value;
	}


	@OneToOne(targetEntity=ExtArchive.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="ExtArchiveID") })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public IExtArchive getArchive() {
		return archive;
	}
	public void setArchive(IExtArchive value) {
		this.archive = value;
	}
	
	
	
	@Column(name="LifeSpanStamp", nullable=true)
	public java.util.Date getLifeSpanStamp() {
		return lifeSpanStamp;
	}
	public void setLifeSpanStamp(java.util.Date value) {
		this.lifeSpanStamp = value;
	}
	
	@Column(name="MainType", nullable=false)
	public byte getMainType() {
		return mainType;
	}
	public void setMainType(byte value) {
		this.mainType = value;
	}
	
	@Column(name="Recordation", nullable=true)
	public java.util.Date getRecordation() {
		return recordation;
	}
	public void setRecordation(java.util.Date value) {
		this.recordation = value;
	}
	
	@Column(name="Submission", nullable=true)
	public java.util.Date getSubmission() {
		return submission;
	}
	public void setSubmission(java.util.Date value) {
		this.submission = value;
	}

	@ManyToOne(targetEntity=hn.sigit.model.ladm.party.LA_Party.class, fetch=FetchType.LAZY)
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})
	@JoinColumns({ @JoinColumn(name="LA_PartyID", referencedColumnName="ID") })
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)
	public hn.sigit.model.ladm.party.LA_Party getParty() {
		return party;
	}
	public void setParty(hn.sigit.model.ladm.party.LA_Party value) {
		this.party = value;
	}
	
	public String toString() {
		return super.toString();
	}
	
}
